package com.sx.gongzhong.pest;

import android.content.Context;

import com.sx.gongzhong.model.ReplyUserBean;
import com.sx.gongzhong.net.ApiManager;
import com.sx.gongzhong.net.BaseCallBack;
import com.sx.gongzhong.view.ForgetPwdView;

import java.util.HashMap;
import java.util.Map;

/**用户忘记密码
 * Created by admin on 2018/1/10.
 */

public class ForgetPwdPest {
    private ForgetPwdView forgetPwdView;

    public ForgetPwdPest(ForgetPwdView forgetPwdView) {
        this.forgetPwdView = forgetPwdView;
    }
    public void forgetpwd(Context context, String phone, String password,String confirmPwd,String token) {
        Map<String,Object> map = new HashMap<>();
        map.put("phone",phone);
        map.put("password",password);
        map.put("confirmPwd",confirmPwd);
        map.put("token",token);
        new ApiManager().forgetpwd(map, new BaseCallBack<ReplyUserBean.BaseResult<Boolean>>() {
            @Override
            public void onSuccess(ReplyUserBean.BaseResult<Boolean> response) {
                forgetPwdView.updateforgetpwdSuccess(response.data);
            }
            @Override
            public void onFailures(String message) {
                forgetPwdView.showError(message);
            }
        });
    }
}
